//
// Created by 32827 on 2023/11/29.
//

#ifndef YZFRAME_YZ_SPI_H
#define YZFRAME_YZ_SPI_H
#include "yz.h"
#include "yz_interrupt.h"

YZF_RESULT yz_spi_init_full_lines(YZF_SPI_POINTER spi);
YZF_RESULT yz_spi_init_full_lines_ex(YZF_SPI_POINTER spi,YZF_SPI_BR br,YZF_BOOL cpol,YZF_BOOL cpha);
YZF_RESULT yz_spi_init_full_hard_lines_ex(YZF_SPI_POINTER spi,YZF_SPI_BR br,YZF_BOOL cpol,YZF_BOOL cpha);
YZF_RESULT yz_spi_init16_full_lines_ex(YZF_SPI_POINTER spi,YZF_SPI_BR br,YZF_BOOL cpol,YZF_BOOL cpha);
YZF_RESULT yz_spi_transmit_full_lines(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);
YZF_RESULT yz_spi_recive_full_lines(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);
uint8_t yz_spi_recive_transmit_full_lines(YZF_SPI_POINTER spi,uint8_t data);
uint16_t yz_spi_recive16_transmit_full_lines(YZF_SPI_POINTER spi,uint16_t data);
void yz_spi_recive_transmit_full_lines_end(YZF_SPI_POINTER spi);
void yz_spi_recive_transmit_full_lines_start(YZF_SPI_POINTER spi);

YZF_RESULT yz_spi_init_normal(YZF_SPI_POINTER spi);
YZF_RESULT yz_spi_transmit_normal(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);
YZF_RESULT yz_spi_recive_normal(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);

YZF_RESULT yz_spi_init_bidi(YZF_SPI_POINTER spi);
YZF_RESULT yz_spi_transmit_bidi(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);
YZF_RESULT yz_spi_recive_bidi(YZF_SPI_POINTER spi,uint8_t* data,uint16_t len);
#endif //YZFRAME_YZ_SPI_H
